package com.xwwx.intercept;

import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import com.xwwx.common.Constant;

/*****************************
 * Created by Eclipse.
 * User: 李伟
 * Date: 2007-03-7
 * 功能: 用户登陆验证拦截器
 ****************************/
@SuppressWarnings("serial")
public class AuthorityInterceptor extends AbstractInterceptor{
	@Override
	public String intercept(ActionInvocation arg0) throws Exception {
		Map session = ActionContext.getContext().getSession();
		Object user = session.get(Constant.USER_SESSION_KEY);
		if(null == user){
			return "index";
		}
		return arg0.invoke();
	}              

}

